-
-
Notifications
You must be signed in to change notification settings - Fork 3k
[mypyc] feat: new primitive for int.bit_length
#19673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! bit_length
can be useful in low-level code, where a generic method call can really slow things down.
I'm not entirely sure how to proceed here, I can't think of any reason our use of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found an issue. Also can you measure the perf difference using a micro-benchmark?
Will this benchmark suffice? I can deploy this commit hash and compare against 1.18 which I already have benchmarked here |
1.18 vs this branch There was a ~6% increase in speed for various permutations of the |
This PR adds a new primitive for
int.bit_length
and is already ready for review.